//
//  NFSCarPriceCollectionViewCell.m
//  NeedForSpeed
//
//  Created by 王国强 on 15/10/16.
//  Copyright © 2015年 Avenger. All rights reserved.
//

#import "NFSCarPriceCollectionViewCell.h"

#import "BaseHeader.h"

@implementation NFSCarPriceCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame
{
    self =[super initWithFrame:frame];
    if (self) {
        [self.contentView setBackgroundColor:[UIColor whiteColor]];
        
        
        self.logoImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height/ 2)];
        [self.contentView addSubview:self.logoImage];
        
        self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, frame.size.height/2 , frame.size.width, frame.size.height / 4)];
        [self.titleLabel setNumberOfLines:0];
        
        [self.contentView addSubview:self.titleLabel];
        
        self.adinfoLabel =[[UILabel alloc]initWithFrame:CGRectMake(0, frame.size.height *3 /4, frame.size.width, frame.size.height/8)];
        
        [self.contentView addSubview:self.adinfoLabel];
        
        self.priceLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, frame.size.height *7/8, frame.size.width /2, frame.size.height / 8)];
        [self.contentView addSubview:self.priceLabel];
        
        self.fctpriceLabel =[[UILabel alloc]initWithFrame:CGRectMake(frame.size.width /2, frame.size.height *7 / 8, frame.size.width /2, frame.size.height / 8)];
        
        [self.contentView addSubview:self.fctpriceLabel];
    }
    return self;
}
-(void)getModel:(NFSCarsPriceModel *)model
{
    NSURL *url = [NSURL URLWithString:model.logo];
    [self.logoImage sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"hoder.jpg"]];
    [self.titleLabel setText:model.title];
    [self.titleLabel setFont:[UIFont systemFontOfSize:14.]];

    [self.adinfoLabel setText:model.adinfo];
    [self.adinfoLabel setFont:[UIFont systemFontOfSize:10.]];
    [self.adinfoLabel setTextColor:[UIColor orangeColor]];
    
    [self.priceLabel setText:model.price];
    [self.priceLabel setFont:[UIFont systemFontOfSize:14.]];
    [self.priceLabel setTextColor:[UIColor redColor]];
    [self.fctpriceLabel setText:model.fctprice];
    [self.fctpriceLabel setFont:[UIFont systemFontOfSize:14.]];
    
}
@end
